package com.lianzhihui.romeex.mvp.presenter;

import android.content.Context;

import com.lianzhihui.romeex.bean.TradeRecordBean;
import com.lianzhihui.romeex.mvp.model.TradeDetailsInterface;
import com.lianzhihui.romeex.mvp.model.TradeDetailsModel;
import com.lianzhihui.romeex.mvp.view.TradeDetailsView;

/**
 * Description:
 * Author: RAMON
 * CreateDate: 2020/11/13 10:05 AM
 * UpdateUser:
 * UpdateDate:
 * UpdateRemark:
 * Version:
 */
public class TradeDetailsPresenter implements TradeDetailsInterface {

    Context context;
    TradeDetailsView iView;
    TradeDetailsModel iModel;

    public TradeDetailsPresenter(Context context, TradeDetailsView iView) {
        this.context = context;
        this.iView = iView;
        iModel = new TradeDetailsModel(context, this);
    }

    public void getTradeDetails(String hashCode) {
        iModel.getTradeDtails(hashCode);
    }

    @Override
    public void onGetTradeDetails(TradeRecordBean.DetailBean bean) {
        iView.onGetTradeDetails(bean);
    }

    @Override
    public void onGetTradeDetailsFail(Object obj) {
        iView.onGetTradeDetailsFail(obj);
    }

    @Override
    public void onFailure() {

    }
}
